import request from '@/utils/request'

const api = {
  list: '/inspection-record/list',
  query: '/inspection-record/query',
  add: '/inspection-record/add',
  update: '/inspection-record/update',
  delete: '/inspection-record/delete',
  detail: '/inspection-record/detail'
}

export default {
  // 获取巡检记录列表
  list(params) {
    return request({
      url: api.list,
      method: 'get',
      params
    })
  },
  
  // 查询巡检记录
  query(params) {
    return request({
      url: api.query,
      method: 'get',
      params
    })
  },
  
  // 新增巡检记录
  add(data) {
    return request({
      url: api.add,
      method: 'post',
      data
    })
  },
  
  // 更新巡检记录
  update(data) {
    return request({
      url: api.update,
      method: 'put',
      data
    })
  },
  
  // 删除巡检记录
  delete(id) {
    return request({
      url: `${api.delete}/${id}`,
      method: 'delete'
    })
  },
  

  
  // 获取巡检记录详情
  detail(id) {
    return request({
      url: `${api.detail}/${id}`,
      method: 'get'
    })
  }
}